﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_Home : System.Web.UI.Page
{
    private Logging objLogging = new Logging();
    private string strApplicationName = MethodBase.GetCurrentMethod().DeclaringType.Name;
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                using (ProjectASPEntities myEntities = new ProjectASPEntities())
                {
                    TextBox1.Text = myEntities.getContent("Home").ToList().First().Value;
                }
            }
        }
        catch (Exception ex)
        {
            objLogging.WriteLine(strApplicationName, ex.Message);
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {
            using (ProjectASPEntities myEntities = new ProjectASPEntities())
            {
                myEntities.updateContent("Home", TextBox1.Text);
            }
        }
        catch (Exception ex)
        {
            objLogging.WriteLine(strApplicationName, ex.Message);
        }
    }
}